﻿package ${config.packageName}<#if table.packageName?exists>${table.packageName}</#if>${entity.packageName};

<#if entity.sqlSession?exists>
import javax.annotation.Resource;
import org.apache.ibatis.session.SqlSession;
</#if>
import org.springframework.stereotype.Repository;

import com.jpgk.base.dao.DefaultBaseDao;
import ${config.packageName}<#if table.packageName?exists>${table.packageName}</#if>.dao.I${table.entityName}Dao;
import ${config.packageName}<#if table.packageName?exists>${table.packageName}</#if>.model.${table.entityName};

/**
 * 类描述：${table.comment}数据操作实现类
 * 此类由IKForm平台自定义业务对象生成
 * @author Inkcar<inkcaridge@qq.com>
 * @since 1.0
 */
 @Repository("${table.entityName}<#if entity.suffix?exists>${entity.suffix}</#if>")
public class ${table.entityName}<#if entity.suffix?exists>${entity.suffix}</#if> extends DefaultBaseDao<${table.entityName}> implements I${table.entityName}Dao{
	<#if entity.sqlSession?exists>
    /**
	 * @param sqlSession
	 *            the sqlSession to set
	 */
	@Resource(name = "${entity.sqlSession}")
	public void setSqlSession(SqlSession sqlSession) {
		super.setSqlSession(sqlSession);
	}
    </#if>
    
    /**
	 * mybatis接口方式数据操作接口定义
	 */
	private I${table.entityName}Dao dao = null;


	/**
	 * 初始化mybatis的数据业务操作类
	 * 
	 * @author 欧阳增高
	 */
	private void initDao() {
		if (dao == null) {
			dao = (I${table.entityName}Dao) getDaoInstance(I${table.entityName}Dao.class);
		}
	}

	@Override
	public I${table.entityName}Dao getDao() {
		initDao();
		return dao;
	}
}